package com.ruoyi.xsp.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.xsp.mapper.XspUserAuthMapper;
import com.ruoyi.xsp.domain.XspUserAuth;
import com.ruoyi.xsp.service.IXspUserAuthService;
import com.ruoyi.common.core.text.Convert;

/**
 * 第三方登录Service业务层处理
 * 
 * @author zhiminhu
 * @date 2021-01-22
 */
@Service
public class XspUserAuthServiceImpl implements IXspUserAuthService 
{
    @Autowired
    private XspUserAuthMapper xspUserAuthMapper;

    /**
     * 查询第三方登录
     * 
     * @param userCode 第三方登录ID
     * @return 第三方登录
     */
    @Override
    public XspUserAuth selectXspUserAuthById(Long userCode)
    {
        return xspUserAuthMapper.selectXspUserAuthById(userCode);
    }

    /**
     * 查询第三方登录列表
     * 
     * @param xspUserAuth 第三方登录
     * @return 第三方登录
     */
    @Override
    public List<XspUserAuth> selectXspUserAuthList(XspUserAuth xspUserAuth)
    {
        return xspUserAuthMapper.selectXspUserAuthList(xspUserAuth);
    }

    /**
     * 新增第三方登录
     * 
     * @param xspUserAuth 第三方登录
     * @return 结果
     */
    @Override
    public int insertXspUserAuth(XspUserAuth xspUserAuth)
    {
        xspUserAuth.setCreateTime(DateUtils.getNowDate());
        return xspUserAuthMapper.insertXspUserAuth(xspUserAuth);
    }

    /**
     * 修改第三方登录
     * 
     * @param xspUserAuth 第三方登录
     * @return 结果
     */
    @Override
    public int updateXspUserAuth(XspUserAuth xspUserAuth)
    {
        return xspUserAuthMapper.updateXspUserAuth(xspUserAuth);
    }

    /**
     * 删除第三方登录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteXspUserAuthByIds(String ids)
    {
        return xspUserAuthMapper.deleteXspUserAuthByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除第三方登录信息
     * 
     * @param userCode 第三方登录ID
     * @return 结果
     */
    @Override
    public int deleteXspUserAuthById(Long userCode)
    {
        return xspUserAuthMapper.deleteXspUserAuthById(userCode);
    }
}
